const MiniCssExtractPlugin = require("mini-css-extract-plugin")

module.exports = {
    mode: "none",
    entry: "./src/index.js",
    output: {
        filename: "bundle.js"
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use: [
                    // "style-loader", // 将样式通过 style 标签注入
                    MiniCssExtractPlugin.loader,
                    "css-loader"
                ]
            },
            {
                test: /\.js$/,
                use: {
                    loader: "babel-lodaer",
                    options: {
                        presets: [
                            ["@babel/preset-env", { modules: false }]
                        ]
                    }
                }
            }
        ]
    },
    optimization: {
        usedExports: true,
        concatenateModules: true
        // minimize: true
    },
    plugins: [
        new MiniCssExtractPlugin()
    ]
}